"""
@author: tian-yan-tian-ge
@file: average-age.py
@time: 2023/12/6 22:00
"""
import pandas as pd

# 读取Excel文件
file_path = 'age.xlsx'  # 请替换为你的Excel文件路径
df = pd.read_excel(file_path, engine='openpyxl')  # 读取Excel文件到DataFrame

print(df["age"])
# 假设"年龄"这一列在DataFrame中的列名为'age'
average_age = df['age'].mean()  # 计算平均年龄

print("平均年龄是:", average_age)